import request from '@/utils/request'
import type {
  RealtimePhysiologicalData,
  HistoricalPhysiologicalData,
  PhysiologicalThresholds
} from '@/types/physiological'
import type { PhysiologicalSettings } from '@/types/settings'

/**
 * 获取实时生理体征数据
 */
export function getRealtimePhysiologicalData(data: any) {
  return request({
    url: '/health_data/v1/list',
    method: 'GET',
    data
  })
}

/**
 * 获取历史生理体征数据（当天）
 */
// export function getHistoricalPhysiologicalData(data: any) {
//   return request({
//     url: '/health_data/v1/list',
//     method: 'GET',
//     data
//   })
// }

/**
 * 获取生理体征阈值设置
 */
export function getPhysiologicalThresholds() {
  return request<PhysiologicalThresholds>({
    url: '/physiological/thresholds',
    method: 'GET'
  })
}

/**
 * 更新生理体征阈值设置
 */
export function savePhysiologicalSettings(data: PhysiologicalSettings) {
  return request({
    url: '/physiologicalParameterThreshold/v1/update',
    method: 'PUT',
    data
  })
}
